convert_l <-
function(kvec, type){
	newkvec <- integer()
	newtype <- character()
	for(i in 1:length(type)){
		if (type[i] == 'l'){
			newkvec <- c(newkvec,rep(1,kvec[i]))
			newtype <- c(newtype,rep('q',kvec[i]))
		}else if(type[i] == 'q'){
			newkvec <- c(newkvec,kvec[i])
			newtype <- c(newtype,type[i])
		}
		
	}
	return(list(kvec=newkvec,type=newtype))
}

